/*
 * @Author: wangguanqing 
 * @Date: 2018-05-12 11:38:53 
 * @Last Modified by: wangguanqing
 * @Last Modified time: 2018-06-08 16:59:03
 */

<template>
  <bg-lay-out>
    <div slot="headerText">财务报表分析</div>
    <top-bar-sel :barWidth="''" slot="headerMain"  :topNav="topNav" @changeTab="onNav"></top-bar-sel>
    <div slot="main" style="position:relative">
    	<div v-if="tabId == '2'">
    		<finan-liabilities :time="finanItem"></finan-liabilities>
    	</div>
    	<div v-if="tabId == '1'">
    		<finan-profit :time="finanItem"></finan-profit>
    	</div>
        <!-- <div v-if="tabId == '3'">
    		<finan-cash-flow :time="finanItem"></finan-cash-flow>
    	</div> -->
    </div>
  </bg-lay-out>
</template>
<script>
import bgLayOut from "@/components/bgLayOut/index";
import finanLiabilities from "./finanLiabilities";
import finanProfit from "./finanProfit";
import finanCashFlow from "./finanCashFlow";
import topBarSel from "@/components/branch/topBarSel";
export default {
  name: "index",
  components: {
    bgLayOut,
    finanLiabilities,
    finanProfit,
    finanCashFlow,
    topBarSel
  },
  data() {
    return {
      tabId: "1",
      finanItem: "",
      topNav: [
        {
          name: "利润表",
          id: "1"
        },
        {
          name: "资产负债表",
          id: "2"
        }
        // {
        //   name: "现金流",
        //   id: "3"
        // }
      ]
    };
  },
  mounted() {},
  methods: {
    onTime(res) {
      this.finanItem = res;
      this.onNav(this.tabId);
    },
    onNav(id) {
      this.tabId = id;
      $(".bg4Con").scrollTop(0);
    },
    // 跳页面
    pushPage(name) {
      this.$router.push({
        path: name
      });
    }
  }
};
</script>
<style>
@import "../../../../styles/element-ui/select.css";
</style>
<style scoped>
.selDateCon {
  position: absolute;
  top: 0;
  z-index: 3;
}
</style>